
package system.base;

import framework.core.*;

/*
	Author    :Wing
	CreateTime:2008-02-20 17:30:49
*/
public class InOutStatisticSearchEvent extends SearchEvent
{

    private String []m_warehouse_codes;
    
    private String m_provider_name = "" ;
    
    private String m_balance_flag = "" ;
    
    private String m_start_statisticTime = "";
    
    private String m_end_statisticTime = "";
    
    private String m_is_normal = "";

    private String m_balance_mode = "";
    
public InOutStatisticSearchEvent() 
{
	super();
}

    public String []getWarehouseCodes()
    {
        return m_warehouse_codes ;
    }
    public void setWarehouseCodes(String []warehouseCodes)
    {
        m_warehouse_codes = warehouseCodes;
    }
    
    public String getProviderName()
    {
        return m_provider_name ;
    }
    public void setProviderName(String v)
    {
        m_provider_name = v;
    }
    
    public String getBalanceFlag()
    {
        return m_balance_flag ;
    }
    public void setBalanceFlag(String v)
    {
        m_balance_flag = v;
    }
    
    public String getStartStatisticTime() {
        return this.m_start_statisticTime;
    }
    public void setStartStatisticTime(String startStatisticTime) {
        this.m_start_statisticTime = startStatisticTime;
    }
    
    public String getEndStatisticTime() {
        return this.m_end_statisticTime;
    }
    public void setEndStatisticTime(String endStatisticTime) {
        this.m_end_statisticTime = endStatisticTime;
    }
    
    public String getIsNormal() {
        return this.m_is_normal;
    }
    public void setIsNormal(String isNormal) {
        this.m_is_normal = isNormal;
    }
    
    public String getBalanceMode() {
        return this.m_balance_mode;
    }
    public void setBalanceMode(String balanceMode) {
        this.m_balance_mode = balanceMode;
    }   
	
/*	public Conditions toConditions() throws Exception
	{
		Conditions c = super.toConditions();

	c.add(getCondition(InHead.ID,getId()));

	c.add(getCondition(InHead.IN_BILL_CODE,getInBillCode()));

	c.add(getCondition(InHead.WAREHOUSE_CODE,getWarehouseCode()));

	c.add(getCondition(InHead.WAREHOUSE_NAME,getWarehouseName()));

	c.add(getCondition(InHead.PROVIDER_CODE,getProviderCode()));

	c.add(getCondition(InHead.PROVIDER_NAME,getProviderName()));

	c.add(getCondition(InHead.OTHER_WAREHOUSE_CODE,getOtherWarehouseCode()));

	c.add(getCondition(InHead.OTHER_WAREHOUSE_NAME,getOtherWarehouseName()));

	c.add(getCondition(InHead.IN_TIME,getInTime()));

	c.add(getCondition(InHead.IN_TYPE,getInType()));

	c.add(getCondition(InHead.IN_MONEY,getInMoney()));

	c.add(getCondition(InHead.SEND_BILL_CODE,getSendBillCode()));

	c.add(getCondition(InHead.REMARK,getRemark()));

	c.add(getCondition(InHead.BALANCE_FLAG,getBalanceFlag()));

	c.add(getCondition(InHead.BALANCE_USER_ID,getBalanceUserId()));

	c.add(getCondition(InHead.BALANCE_USER,getBalanceUser()));

	c.add(getCondition(InHead.BALANCE_TIME,getBalanceTime()));

	c.add(getCondition(InHead.STATUS,getStatus()));

	c.add(getCondition(InHead.CREATE_USER_ID,getCreateUserId()));

	c.add(getCondition(InHead.CREATE_USER,getCreateUser()));

	c.add(getCondition(InHead.CREATE_TIME,getCreateTime()));

	c.add(getCondition(InHead.LAST_UPDATE_USER_ID,getLastUpdateUserId()));

	c.add(getCondition(InHead.LAST_UPDATE_USER,getLastUpdateUser()));

	c.add(getCondition(InHead.LAST_UPDATE_TIME,getLastUpdateTime()));

	c.add(getCondition(InHead.IS_SYNC,getIsSync()));
		
	//add by Wing start
	if (getWarehouseCodes() != null) {
        c.add(InHead.WAREHOUSE_CODE,Conditions.IN,getWarehouseCodes());
    }
	if (!getProductCode().equalsIgnoreCase("")) {
	    c.add(InHead.ID + " in (select in_bill_id from t_in_sub where product_code = ?)",Conditions.CUSTOM,getProductCode());
	}
	if (!getProductName().equalsIgnoreCase("")) {
        c.add(InHead.ID + " in (select in_bill_id from t_in_sub where product_name = ?)",Conditions.CUSTOM,getProductName());
    }
	if (!getKeyWord().equalsIgnoreCase(""))
    {
        String[] keyWord = new String[7];
        keyWord[0] = "%" + viewKeyWord().toUpperCase() + "%";
        keyWord[1] = viewKeyWord().toUpperCase();
        keyWord[2] = "%" + viewKeyWord().toUpperCase() + "%";
        keyWord[3] = "%" + viewKeyWord().toUpperCase() + "%";
        keyWord[4] = "%" + viewKeyWord().toUpperCase() + "%";
        keyWord[5] = "%" + viewKeyWord().toUpperCase() + "%";
        keyWord[6] = viewKeyWord().toUpperCase();
        
        c.add(InHead.ID + " in (select in_bill_id from t_in_sub a,t_product b where a.product_code = b.CONCENTRICITY_CODE and b.NAME like ? or b.CONCENTRICITY_CODE = ? or b.MODEL like ? " +
              "or b.SPEC like ? or b.PRODUCT_BRAND like ? or b.MANUFATURER like ? or b.APPENDER_PROPERTY like ? )",Conditions.CUSTOM,keyWord); 
    }
    if (!getBalanceMode().equalsIgnoreCase(""))
    {
        c.add(InHead.ID + " in (select in_bill_id from t_in_sub where balance_mode = ?)",Conditions.CUSTOM,getBalanceMode());
    }
    if (!getIsNormal().equalsIgnoreCase(""))
    {
        c.add(InHead.ID + " in (select in_bill_id from t_in_sub a,t_product b where a.product_code = b.CONCENTRICITY_CODE and b.is_normal = ?)",Conditions.CUSTOM,getIsNormal());
    }
    
    if (!getStartInTime().equalsIgnoreCase("")) {
        c.add(" in_time >= ?",Conditions.CUSTOM,getStartInTime()+" 00:00:00");
    }
    
    if (!getEndInTime().equalsIgnoreCase("")) {
        c.add(" in_time <= ?",Conditions.CUSTOM,getEndInTime()+" 23:59:59");
    }
    //add by Wing end
			
		return c ;
	}
*/
    
    //add by Jackey start    
    private String m_warehouse_code_user = "" ; // all
    public String getWarehouseCodeUser()
    {
        return m_warehouse_code_user ;
    }
    public void setWarehouseCodeUser(String v)
    {
        m_warehouse_code_user = v;
    }
    public String viewWarehouseCodeUser() throws Exception
    {
        return Value.view(getWarehouseCodeUser());
    }
  //add by Jackey end
    
    //add by benny start
    private String m_product_code = "";
    public String getProductCode(){
        return m_product_code;
    }
    public void setProductCode(String v)
    {
        m_product_code = v;
    }
    
    private String m_product_name = "";
    public String getProductName(){
        return m_product_name;
    }
    public void setProductName(String v)
    {
        m_product_name = v;
    }
    
    private String m_product_brand = "";
    public String getProductBrand(){
        return m_product_brand;
    }
    public void setProductBrand(String v)
    {
    	m_product_brand = v;
    }
    //add bu benny end
}
